
#include "MoveHistory.h"

//! Saves the history to the provided ostream
//! @param os the ostream to be written to
//! @returns the ostream
std::ostream & MoveHistory::SaveHistory(std::ostream & os) {

   os << "<history>" << std::endl;

   for (unsigned i=0; i<moveList.size(); i++) {
      moveList[i].Save(os);
   }

   os << "</history>" << std::endl;
   return os;
}

//! Undo the last Move in the list
Move MoveHistory::UndoMove() {
   if (moveList.empty())
      return Move();
   Move m(moveList.back());
   moveList.pop_back();
   return m;
}

void MoveHistory::AddMove(Move m){
   moveList.push_back(m);
}

//! Loads the previously stored History from the file
void MoveHistory::LoadHistory(std::string filename) {
   
}

void MoveHistory::Initialize() {
   
}
